package com.api.client.log;

import com.api.client.Request;
import com.api.client.Response;
import com.api.client.imp.RequestImp;

public aspect LogRequest {
	
	before(Request request) : execution(* RequestImp.send()) && target(request) && args(){
		
		ApiLogger.logRequest(request);
	}
	
	after(Request request) returning (Response response): execution(* RequestImp.send()) && target(request) && args(){
		
		ApiLogger.logResponse(request, response);
	}
	
	before(Request request, String accessKey, String accessSecret) : execution(* RequestImp.sendSigned(String, String)) && args(accessKey, accessSecret) && target(request) {
		
		ApiLogger.logSignedRequest(request, accessKey, accessSecret);
	}
}